package com.project.music.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * swagger配置
 */

@Configuration
public class SwaggerConfig {

    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.OAS_30).apiInfo(
                new ApiInfoBuilder()
                        .contact(new Contact("zc", "", "1309634016@qq.com"))
                        .title("Music Website")
                        .description("music-website api")
                        .version("v1.0")
                        .build()
        ).select()
                .apis(RequestHandlerSelectors.basePackage("com.project.music.controller"))
                .build();
    }
}
